package com.itlong.cloud.user.app;

import com.itlong.cloud.POJO.PO.PropertyParkCouponPO;
import com.itlong.cloud.POJO.VO.app.AppGetCouponListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      优惠券相关暴露接口
 * <desc/>
 *
 * @createDate 2018/11/08
 */
@FeignClient(name="user-service")
public interface IAppCouponServiceClient {

    /**
     * <desc>
     *      获取优惠券列表
     * </desc>
     *
     * @return 优惠券列表
     * @author wanghzi
     * @createDate 2018/11/09
     */
    @PostMapping(path = "app/coupon/getCouponList")
    List<AppGetCouponListVO> getCouponList(@RequestParam("phoneNo") String phoneNo, @RequestParam(value = "projectId", required = false) String projectId,
                                           @RequestParam(value = "redeemCode",required = false) String redeemCode,
                                           @RequestParam(value = "type", required = false) String type) throws Exception;

    /**
     * <desc>
     *      获取优惠券信息 By 兑换码
     * </desc>
     *
     * @return 优惠券信息
     * @author wanghzi
     * @createDate 2018/11/09
     */
    @PostMapping(path = "app/coupon/getCouponByRedeemCode")
    PropertyParkCouponPO getCouponByRedeemCode(@RequestParam("redeemCode") String redeemCode) throws Exception;

    /**
     * <desc>
     *      添加(兑换)优惠券
     * </desc>
     *
     * @return 添加的优惠券
     * @author wanghzi
     * @createDate 2018/11/09
     */
    @PostMapping(path = "app/coupon/addCoupons")
    AppGetCouponListVO addCoupons(@RequestBody PropertyParkCouponPO propertyParkCouponPO) throws Exception;
}
